package de.tuberlin.dima.dkey.util;

import java.io.Serializable;

public class GEdge implements Serializable {

	private static final long serialVersionUID = 1L;
	
	private int source;
	private int sink;
	private int graph;
	
	public GEdge(){
		throw new UnsupportedOperationException(); 
	}
	
	public GEdge(int graph, int source, int sink){
		this.source = source;
		this.sink = sink;
		this.graph = graph;
	}
	
	public int getSource(){
		return source;
	}
	
	public int getSink(){
		return sink;
	}
	
	public int getGraph(){
		return graph;
	}
	
	@Override public String toString() {
		return graph+":"+source+"->"+sink;
	}
	
	/**
     * Returns the hash code value for this edge.
     *
     * @return the hash code value for this list
     */
    public int hashCode() {
        int hashCode = 1;
        
        hashCode = 31*hashCode + source;
        hashCode = 31*hashCode + sink;
        
        return hashCode;
    }
	
}